home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / win / general / wsheap.exe / EXMSCHP.CPP < prev    next >
Text File  |  1993-01-27  |  769b  |  31 lines

  1. //EXMSCHP.CPP
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <malloc.h>
  5. #include <iostream.h>
  6. #include <memory.h>
  7. #include <windows.h>
  8. #include <wsheap.h>
  9.  
  10. #if defined (STRICT)
  11. int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
  12.                    LPSTR lpCmdLine, int nCmdShow) {
  13. #else
  14. int PASCAL WinMain(HANDLE hInstance, HANDLE hPrevInstance,
  15.                    LPSTR lpszCmdLine, int cmdShow) {
  16. #endif
  17.   LPVOID P1, P2;
  18.   THeapState HS;
  19.  
  20.   SaveHeapState(&HS, sfMSC);
  21.   P1 = _fmalloc(800);
  22.   P2 = _fmalloc(100);
  23.   //...
  24.   _ffree(P1);
  25.   CompareHeapState(&HS, "EXMSCHP.DMP", "MSC Test (changes expected)");
  26.   _ffree(P2);
  27.   CompareHeapState(&HS, "EXMSCHP.DMP", "MSC Test (all disposed)");
  28.   DoneHeapState(&HS);
  29.   return 0;
  30. }
  31.